-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: Optimize and refactor doc link resolution #96135
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in cc @camelid |
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit afd1ce9da528a376d8bf532fc73ea6b30f96081f with merge 17cff29288d7f9f1378ebd548ff5a4994de8c57c... |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 76077f923a7536b844a854078dcfa093524c5c27 with merge cd5dce912ebe17db000b68c530333a49ad85d462... |
☀️ Try build successful - checks-actions |
Queued cd5dce912ebe17db000b68c530333a49ad85d462 with parent 1ec2c13, future comparison URL. |
Finished benchmarking commit (cd5dce912ebe17db000b68c530333a49ad85d462): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
Seems like you're almost done in here! :D |
@GuillaumeGomez tt-muncher seems to fluctuate a lot for reasons unrelated to this PR. |
@GuillaumeGomez |
Are there any specific crates in the benchmark suite that use these doc links a lot? I can try to profile them and look for potential bottlenecks. |
Thanks @petrochenkov ! Let's go then. :) @bors: r+ |
📌 Commit ca5c752 has been approved by |
@bors rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d39864d): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
…nks-filtering, r=notriddle Prevent `<>` links to be interpreted for intra-doc links As discussed in [this thread](rust-lang#96135 (comment)). As mentioned, the intra-doc RFC states that `<>` links shouldn't be potential intra-doc links: https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html#no-autolinks-style. I renamed `markdown_links` into `potential_intra_doc_markdown_links` to make it more obvious what it's doing. cc `@petrochenkov` r? `@notriddle`
rustdoc: Optimize IdMap Slightly optimizes `IdMap`, which is hot in `markdown_links` (context [here](rust-lang#96135 (comment))). There are more improvements that can be made near this place, but this seemed like an easy win locally (although I tried it on top of rust-lang#94857, so let's see what happens without that PR). r? `@petrochenkov`
@petrochenkov said:
Given that besides that benchmark, this is a win (and sometimes a big one), I'll mark this as triaged. @rustbot label: +perf-regression-triaged |
rustdoc: Resolve doc links on fields during early resolution Another subset of rust-lang#94857 which fixes rust-lang#96429. This case regressed in rust-lang#96135 when `may_have_doc_links`-based filtering was introduced. Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
rustdoc: Resolve doc links on fields during early resolution Another subset of rust-lang#94857 which fixes rust-lang#96429. This case regressed in rust-lang#96135 when `may_have_doc_links`-based filtering was introduced. Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
One more subset of #94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it.
It's better to read individual commits and their descriptions to understand the changes.
The
may_have_doc_links
optimization is not very useful here, but it's much more important for #94857.Closes #96079